'''【ac】原来split()和split(' ')会不一样'''
def method(a, b):
    # 处理
    a.sort()
    b.sort()

    # 计数
    count, i, j = [0] * 3
    while i < len(b):
        while j < len(a) and a[j] * 2 <= b[i]:
            j += 1
        if j >= len(a):
            break 
        count += 1
        i += 1
        j += 1
    return count 

if __name__ == '__main__':
    n = int(input())
    a = [int(x) for x in input().split()]
    b = [int(x) for x in input().split()]
    count = method(a, b)
    print(count)
